package com.nail.soulda.fighter;

import com.nail.soulda.person.IPerson;

public class NormalFighter extends IFighter {

	@Override
	public void fight(IPerson soulda, IPerson boss) {
		try {
			while (true) {
				/* soulda attack first */
				System.out.println(soulda.getName() + " attack, " + boss.getName() + " lose " + soulda.attack());
				if (boss.loseBlood(soulda.attack()) <= 0) {
					System.out.println("boss: " + boss.getName() + " dead, you win!!");
					return;
				}
				Thread.sleep(1000);				
				
				/* boss attack */
				System.out.println(boss.getName() + " attack, " + soulda.getName() + " lose " + boss.attack());
				if (soulda.loseBlood(boss.attack()) <= 0) {
					System.out.println(soulda.getName() + " dead !!");
					return;
				}
				/* check if soulda dead */
				
				Thread.sleep(1000);
			}
		} catch (InterruptedException e) {			
			e.printStackTrace();
		}
	}
}
